package cn.sfa.common.jms;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import cn.sfa.entity.news.SaleNewsSee;
import cn.sfa.service.news.PreNewsService;
/**
 * 
* 类名称：ResourceMessageConsumer   
* 类描述： 消息消费者
* 创建人：lenovo   
* 创建时间：2012-2-9 下午6:07:19      
* 修改备注：   
* @version
 */
@Component
public class ResourceMessageConsumer {
	private Logger log = LoggerFactory.getLogger(ResourceMessageConsumer.class);
	@Autowired
	private PreNewsService preNewsService;
 

	public void addResource(Object obj) {
		log.info("=======================================");
		if(obj instanceof String){
			log.info("receiveing String message ...");
		} else{
			log.info("cannot receiveing this message ...");
		}
		SaleNewsSee b=(SaleNewsSee)obj;
		 
		boolean flag=preNewsService.newsCount(b);
		if(flag)
			log.info("===================================统计访问量成功");
		else
			log.info("===================================统计访问量失败");
		
		log.info("=======================================");
	}



}
